package com.dongdongshop.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.dongdongshop.mapper.TbSpecificationOptionMapper;
import com.dongdongshop.pojo.specification.TbSpecificationOption;
import com.dongdongshop.pojo.specification.TbSpecificationOptionExample;
import com.dongdongshop.service.SpecificationOptionServiceI;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;

@Component
@Service
public class SpecificationOptionServiceImpl implements SpecificationOptionServiceI {
   @Resource
   private TbSpecificationOptionMapper specificationOptionMapper;

    @Override
    public List<TbSpecificationOption> listOptionsBySpecId(Long id) {
        return specificationOptionMapper.listOptionsBySpecId(id);
    }

    @Override
    public List<TbSpecificationOption> findOptionsById(Long id) {
        TbSpecificationOptionExample example=new TbSpecificationOptionExample();
        TbSpecificationOptionExample.Criteria criteria = example.createCriteria();
        criteria.andSpecIdEqualTo(id);
        return specificationOptionMapper.selectByExample(example);
    }
}
